package com.wpp;

/*
 * 枚举类的对象是有限个，是确定的
 * 当需要定义一组常量时，强烈建议使用枚举类
 * 自定义枚举类
 *
 *
 *
 *
 *
 * */
public class EnumTest {
    public static void main(String args[]) {
        EnumTests E = EnumTests.SPRING;
        System.out.println(E.getGg());
        System.out.println(E);
    }
}

class EnumTests {

    //1.声明属性
    private final String jj;
    private final String gg;

    //2.构造器赋值
    private EnumTests(String jj, String gg) {
        this.jj = jj;
        this.gg = gg;
    }
    //3.提供当前枚举类的多个对象

    public static final EnumTests SPRING = new EnumTests("春天", "春暖花开");
    public static final EnumTests SUMMER = new EnumTests("夏天", "热");
    public static final EnumTests AUTIMU = new EnumTests("秋天", "秋");
    public static final EnumTests WINTER = new EnumTests("冬天", "冷");

    public String getJj() {
        return jj;
    }

    public String getGg() {
        return gg;
    }

    @Override
    public String toString() {
        return "EnumTests{" +
                "jj='" + jj + '\'' +
                ", gg='" + gg + '\'' +
                '}';
    }
}